import mockRequest from '@/utils/MockRequest'
import request from '@/utils/request'

/**
 * @desc 获取地址数据
 * @returns Promise
 */
export const address = () => {
  return mockRequest({
    method: 'GET',
    url: '/address'
  })
}

export const getListOfPurchasedProducts = () => {
  return request({
    method: 'GET',
    url: '/api/order/auth/trade'
  })
}

/**
 * @desc https://www.showdoc.com.cn/2077491945864902/9443888348945332
 * @param data
 * @returns Promise
 */
export const placeOrder = (data) => {
  return request({
    method: 'POST',
    url: `/api/order/auth/submitOrder?tradeNo=${data.tradeNo}`,
    data: data
  })
}
